#include <iostream>
#include <cstdio>
#include <stack>
#include <string>
using namespace std;
string a;
int main()
{
    char s[13];
    int sum = 0;
    cin >> a;
    for (int i = 0, j = 1; i < a.size() - 2; i++)
    {
        if (a[i] != '-')
        {
            sum += (a[i] - 48) * j;
            j++;
            //cout << (a[i] - 48) * j << " ";
        }
    }
    if (sum % 11 == (a[12] - 48))
    {
        cout << "Right" << endl;
        return 0;
    }
    if ((sum % 11 == 10) && a[12] == 'X')
    {
        cout << "Right" << endl;
        return 0;
    }
    for (int i = 0; i < a.size(); i++)
    {
        if (i != a.size() - 1)
            cout << a[i];
        else
        {
            if (sum % 11 != 10)
                cout << sum % 11;
            else
                cout << 'X';
        }
    }
    //cout << sum;
    return 0;
}